var exec = require('cordova/exec');
var PLUGIN_NAME = 'AliCloudMobile';

var AliCloudMobile = {
  setAuthSDKInfo: function(sdkInfo, languageInfo, successCallback, errorCallback) {
    exec(successCallback, errorCallback, PLUGIN_NAME, 'setAuthSDKInfo', [sdkInfo, languageInfo]);
  },
  getLoginToken: function(timeout, successCallback, errorCallback) {
    exec(successCallback, errorCallback, PLUGIN_NAME, 'getLoginToken', [timeout]);
  },
  cancelLogin: function(successCallback, errorCallback) {
    exec(successCallback, errorCallback, PLUGIN_NAME, 'cancelLogin', []);
  },
  accelerateLoginPage: function(timeout, successCallback, errorCallback) {
    exec(successCallback, errorCallback, PLUGIN_NAME, 'accelerateLoginPage', [timeout]);
  },
  checkEnvironment: function(authType, successCallback, errorCallback) {
    exec(successCallback, errorCallback, PLUGIN_NAME, 'checkEnvironment', [authType]);
  },
  isChinaMobile: function(successCallback, errorCallback) {
    exec(successCallback, errorCallback, PLUGIN_NAME, 'isChinaMobile', []);
  },
  isChinaTelecom: function(successCallback, errorCallback) {
    exec(successCallback, errorCallback, PLUGIN_NAME, 'isChinaTelecom', []);
  },
  getCurrentCarrierName: function(successCallback, errorCallback) {
    exec(successCallback, errorCallback, PLUGIN_NAME, 'getCurrentCarrierName', []);
  },
  simSupportedIsOK: function(successCallback, errorCallback) {
    exec(successCallback, errorCallback, PLUGIN_NAME, 'simSupportedIsOK', []);
  },
  getUniqueID: function(successCallback, errorCallback) {
    exec(successCallback, errorCallback, PLUGIN_NAME, 'getUniqueID', []);
  }
};

module.exports = AliCloudMobile;